package com.chenfan.process.controller;

import com.chenfan.ccp.common.result.R;
import com.chenfan.infra.annotation.Log;
import com.chenfan.process.biz.ApprovalTransferBiz;
import com.chenfan.process.entity.dto.ApprovalDataTransferDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

/**
 * @author liuming
 * @date 2021/10/18
 */
@Api(tags = "审批流数据转移")
@RestController
@RequestMapping("/approval/transfer")
public class ApprovalTransferController {

    @Autowired
    private ApprovalTransferBiz approvalTransferBiz;

    /**
     * 审批数据迁移
     * @param data 数据参数
     * @return
     * @throws ExecutionException
     * @throws InterruptedException
     */
    @Log(title = "审批数据迁移")
    @ApiOperation("审批数据迁移")
    @PutMapping("")
    public R<Void> approvalDataTransfer(@RequestBody ApprovalDataTransferDTO data)
        throws ExecutionException, InterruptedException {
        approvalTransferBiz.approvalDataTransfer(data);
        return R.ok();
    }
}
